package gold.digger;

import gold.vo.TreeNode;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC617 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public TreeNode mergeTrees(TreeNode t1, TreeNode t2) {
            if (null == t1 && null == t2) return null;
            if (null != t1 && null != t2) {
                t1.val += t2.val;
                t1.right = mergeTrees(t1.right, t2.right);
                t1.left = mergeTrees(t1.left, t2.left);
                return t1;
            }
            return null == t1 ? t2 : t1;
        }
    }

    public void run() {
        Solution solution = new Solution();
        List<Integer> list = new ArrayList<>();
        System.out.println(solution.toString());
    }

    public static void main(String[] args) throws Exception {
        LC617 an = new LC617();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
